import React from "react";

export const getStorage = (key) => localStorage.getItem(key)


export const auth = {
    login: JSON.parse(getStorage('login')) || false,
    onLoginSuccess: () => {},
    token: getStorage('token') || '',
    refreshToken: getStorage('refreshToken') || '',
    username: getStorage('username') || '',
    perm: getStorage('perm'),
}

export const GlobalContext = React.createContext({
    auth: auth,
})
